#pragma once

#include <d3d9.h>
#include <d3dx9.h>
#include <math.h>
#include "../Local.h"
#include "../XenMemory/XenMemory.h"
#include "../PacketHandler/PacketHandler.h"
#include "../Input.h"

class XenItemSniffer
{
private:
	XenMemory *xenMemory;

	IDirect3DDevice9 *pIDirect3DDevice9;

	static bool itemCompass;
	
	int screenWidth;
	int screenHeight;

	float scaleX;
	float scaleY;

	D3DXFONT_DESC fitemList;
	LPD3DXFONT itemListFont;

	string itemList;
	std::vector<D3DXVECTOR2> itemLocations;

#define ARROW_LOC  "xenergy/images/arrow.png"
	LPDIRECT3DTEXTURE9 arrowTexture;
	LPD3DXSPRITE arrowSprite;

	static DWORD WINAPI ProcessPackets(LPVOID lpParameter);	

public:
	XenItemSniffer(IDirect3DDevice9 *pIDirect3DDevice9);

	void Initialize();
	void StartSnifferThread();
	void Render();
	void Release();
	int ReadMemLocUInt(int);
};